<%@ page import="com.nus.beans.User" %>
<%@ page import="com.nus.beans.UserType" %>
<%@ page import="org.apache.commons.lang3.StringEscapeUtils" %>
<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 9/16/12
  Time: 12:55 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Home Page</title></head>
<body>Developer home page</body>

<% User user = (User) session.getAttribute("user");
%>
<table>
    <tr>
        <td>Welcome, <%= StringEscapeUtils.escapeXml(user.getLastName())%>
        </td>
        <td>
            <form action="logout.do" method="post"><input type="submit" value="Logout"></form>
        </td>
    </tr>
</table>
<br/>

<table>

    <tr>
        <td><a href="LoadUpdateUser.do">Update Personal Information</a>
        <td>
    </tr>
    <tr>
        <td><a href="viewUsers.do">Manage Users</a>
        <td>
    </tr>
     <% if(user.getUserType().equals(UserType.HR_MGR)){ %>
    <tr>
        <td><a href="loadCreateUserInfo.do">Create User</a>
        <td>
    </tr>

    <% } %>
    <tr>
        <td><a href="viewApplyLeaves.do">Apply Leave</a>
        <td>
    </tr>
    <tr>
        <td><a href="viewLeavesHistory.do">View Leave History</a>
        <td>
    </tr>
    <% if(user.getUserType().equals(UserType.PM) || user.getUserType().equals(UserType.HR_MGR) || user.getUserType().equals(UserType.HR_ASST)){%>
    <tr>
        <td><a href="viewPendingLeaves.do">View Pending Leaves</a>
        <td>
    </tr>
    <% } %>


    <% if (user.getUserType().equals(UserType.PM) || user.getUserType().equals(UserType.DEVELOPER)) { %>
    <tr>
        <td><a href="viewProjects.do">View Projects</a>
        <td>
    </tr>
    <% }
        if (user.getUserType().equals(UserType.PM)) { %>
    <tr>
        <td><a href="LoadcreateProjects.do">Create Project</a>
        <td>
    </tr>
    <% } %>


    <tr>
        <td><a href="viewChangePassword.do">Change Password</a>
        <td>
    </tr>

</table>
</html>